package com.oj.judge.codesandbox.impl;

import com.oj.judge.codesandbox.CodeSandBox;
import com.oj.judge.domain.ExecuteCodeRequest;
import com.oj.judge.domain.ExecuteCodeResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @Classname CodeSandBoxProxy
 * @Description TODO
 * @Date 2025/3/17 23:18
 * @Created by xxx
 */
@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CodeSandBoxProxy implements CodeSandBox {

    private CodeSandBox codeSandBox;

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱的请求信息{}", executeCodeRequest.toString());
        ExecuteCodeResponse executeCodeResponse = codeSandBox.executeCode(executeCodeRequest);
        log.info("代码沙箱的响应信息{}", executeCodeResponse.toString());
        return executeCodeResponse;
    }
}
